import { App} from 'vue'
export default {
	// 通过install 方法
    install(app:App, ) {
        app.directive('MyRepeat', {
            mounted: function(el: HTMLButtonElement, binding: any) {
                el.addEventListener('click',() => {
                    console.log(el.disabled);
                    if (!el.disabled) {
                        console.log(111);
                        el.disabled = true
                        let timer: any | undefined = setTimeout(():void => {
                            el.disabled = false
                            clearTimeout(timer)
                            timer = undefined
                        }, binding.value || 3000)
                    }
                })
            }
        })
    }
}
